﻿using System.Drawing;
using System.Windows.Forms;

namespace CloudShot.Utils.Converters
{
  public static class AlignmentConverter
  {
    public static HorizontalAlignment ToHorizontalAlignment(this StringAlignment align)
    {
      switch (align)
      {
        case StringAlignment.Near:
          return HorizontalAlignment.Left;
        case StringAlignment.Center:
          return HorizontalAlignment.Center;
        case StringAlignment.Far:
          return HorizontalAlignment.Right;
      }

      return HorizontalAlignment.Left;
    }

    public static StringAlignment ToStringAlignment(this HorizontalAlignment align)
    {
      switch (align)
      {
        case HorizontalAlignment.Left:
          return StringAlignment.Near;
        case HorizontalAlignment.Center:
          return StringAlignment.Center;
        case HorizontalAlignment.Right:
          return StringAlignment.Far;
      }

      return StringAlignment.Near;
    }
  }
}